<?
class adsModel extends iMVC_Model{

   public $_table='ads'; 
   public $_pk='ads_id';


   public function getTopAds(){
       $reader=$this->db->getDbReader();
       $sql="select * from $this->_table where ads_issug=1";
       $res=$reader->readByQuery($sql);
       if($res!=null){
           return $res;
       }
       else{
           return false; 
       }

   }
   public function fetchByKeyword($keyword){
   
       $reader=$this->db->getDbReader();
       $sql="select * from $this->_table where concat(ads_name,ads_address,ads_content) like '%$keyword%'";
       $res=$reader->readByQuery($sql);
       if($res!=null){
            return $res;
        }
        else{
            return false; 
        }  
   
   }


  
}


// vim600:ts=4 st=4 foldmethod=marker foldmarker=<<<,>>>
// vim600:syn=php commentstring=//%s
